package com.ct.gd.passport.view.passport;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.ct.gd.passport.R;
import com.ct.gd.passport.common.BaseActivity;
import com.ct.gd.passport.common.constants.Config;
import com.ct.gd.passport.view.widget.CustomHeaderFragment;

public class PassportWeekendReservationQueryActivity extends BaseActivity {
	
	private WebView mWbQuery;

	@Override
	protected void onBaseCreate(Bundle savedInstanceState) {
		setContentView(R.layout.passport_weekend_reservation_query);
	}

	@Override
	protected void initViews() {
		CustomHeaderFragment header = (CustomHeaderFragment) getFragmentManager().findFragmentById(R.id.header);
		header.setCenterText(R.string.passport_submit_weekend_query);
		mWbQuery = (WebView)findViewById(R.id.wb_passport_weekend_reservation_query);
	}
	
	@Override
	protected void onResume() {
		mWbQuery.getSettings().setJavaScriptEnabled(true);
		mWbQuery.setOnLongClickListener(new OnLongClickListener() {
			
			@Override
			public boolean onLongClick(View v) {
				return true;
			}
		});
		
		mWbQuery.setWebViewClient(new WebViewClient(){
			@Override
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				return true;
			}
		});
		StringBuffer sBuffer = new StringBuffer();
		sBuffer.append(Config.YY_URL);
		System.out.println(sBuffer.toString());
		mWbQuery.loadUrl(sBuffer.toString());
		mWbQuery.requestFocus();
		super.onResume();
	}

}
